package com.rayboo.example.design.pattern.factory.normal;

public class SuvCarFactory {

    public static final String RED = "red";
    public static final String GREEN = "green";
    public static final String BLUE = "blue";

    public SuvCar create(String color) {
        if (RED.equals(color)) {
            return new SuvCar(RED);
        } else if (GREEN.equals(color)) {
            return new SuvCar(GREEN);
        } else if (BLUE.equals(color)) {
            return new SuvCar(BLUE);
        } else {
            throw new RuntimeException("No " + color + " suv car.");
        }
    }
}
